package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;

import com.ruoyi.system.mapper.api.WCoinPriceMapper;
import com.ruoyi.system.domain.api.WCoinPrice;
import com.ruoyi.system.service.IWCoinPriceService;

/**
 * 币种价格Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-22
 */
@DataSource(DataSourceType.SLAVE)
@Service
public class WCoinPriceServiceImpl implements IWCoinPriceService 
{
    @Autowired
    private WCoinPriceMapper wCoinPriceMapper;

    /**
     * 查询币种价格
     * 
     * @param id 币种价格主键
     * @return 币种价格
     */
    @Override
    public WCoinPrice selectWCoinPriceById(Long id)
    {
        return wCoinPriceMapper.selectWCoinPriceById(id);
    }

    /**
     * 查询币种价格列表
     * 
     * @param wCoinPrice 币种价格
     * @return 币种价格
     */
    @Override
    public List<WCoinPrice> selectWCoinPriceList(WCoinPrice wCoinPrice)
    {
        return wCoinPriceMapper.selectWCoinPriceList(wCoinPrice);
    }

    /**
     * 新增币种价格
     * 
     * @param wCoinPrice 币种价格
     * @return 结果
     */
    @Override
    public int insertWCoinPrice(WCoinPrice wCoinPrice)
    {
        return wCoinPriceMapper.insertWCoinPrice(wCoinPrice);
    }

    /**
     * 修改币种价格
     * 
     * @param wCoinPrice 币种价格
     * @return 结果
     */
    @Override
    public int updateWCoinPrice(WCoinPrice wCoinPrice)
    {
        wCoinPrice.setUpdateTime(DateUtils.getNowDate());
        return wCoinPriceMapper.updateWCoinPrice(wCoinPrice);
    }

    /**
     * 批量删除币种价格
     * 
     * @param ids 需要删除的币种价格主键
     * @return 结果
     */
    @Override
    public int deleteWCoinPriceByIds(Long[] ids)
    {
        return wCoinPriceMapper.deleteWCoinPriceByIds(ids);
    }

    /**
     * 删除币种价格信息
     * 
     * @param id 币种价格主键
     * @return 结果
     */
    @Override
    public int deleteWCoinPriceById(Long id)
    {
        return wCoinPriceMapper.deleteWCoinPriceById(id);
    }
}
